/*
  FILENAME  : qa_drop_table.sql
  OBJECT    : qa_drop_table
  TYPE		: STORED PROCEDURE
  PURPOSE   : utility script to drop tables.
  SYNTAX	: EXEC qa_drop_table table_name1
  EXAMPLE	: EXEC qa_drop_table TelltaleCompare
  TODO      : 
*/

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'qa_drop_table') 
	AND type in (N'P'))
BEGIN
	DROP PROCEDURE qa_drop_table
END
GO

CREATE PROCEDURE qa_drop_table
	@t1 varchar(160)
AS

DECLARE @vsql nvarchar(400)

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(@t1) AND type in (N'U')) 
BEGIN
	SET @vsql = 'DROP table '+@t1
	EXEC  sp_executesql @vsql
END

GO
